const inputs = document.querySelectorAll(".input");

function focusFunction(){
  let parentNode = this.parentNode.parentNode;
  parentNode.classList.add('focus');
}
function blurFunction(){
  let parentNode = this.parentNode.parentNode;
  if(this.value == ''){
    parentNode.classList.remove('focus');
  }
}

inputs.forEach(input=>{
  input.addEventListener('focus',focusFunction);
  input.addEventListener('blur',blurFunction);
});
